<?php

class Admin_Model_DbTable_LessionLibsExam extends Zend_Db_Table_Abstract
{

    protected $_name = 'lession_libs_exam';

    public function getAllLession(){
    	return $this->fetchAll();
    }
    
    public function getLessionLibByID($lessionID){
    	return $this->fetchRow("lession_test_id = $lessionID");
    }
    
    public function addLessionLib($LTName,$LTDesc,$lessionID,$teacherID,$skillID,$auto){
    	$data = array(
    			"lession_test_name"=>$LTName,
    			"lession_test_description"=>$LTDesc,
    			"lession_id"=>$lessionID,
    			"teacher_id"=>$teacherID,
    			"skill_id"=>$skillID,
    			"auto"=>$auto
    	);
    	return $this->insert($data);
    }
    
    public function updateLessionLib($LTID,$LTName,$LTDesc,$lessionID,$teacherID,$skillID,$auto){
    	$data = array(
    			"lession_test_name"=>$LTName,
    			"lession_test_description"=>$LTDesc,
    			"lession_id"=>$lessionID,
    			"teacher_id"=>$teacherID,
    			"skill_id"=>$skillID,
    			"auto"=>$auto
    	);
    	return $this->update($data, "lession_test_id = $LTID");
    }

}

